public class TestMedian {
    public static void main(String[] args) {
        System.out.println(median(7, 3, 9));        // 7
        System.out.println(median(29, -14, 11));    // 11
        System.out.println(median(752, 64, 121));   // 64
    }
    
    public static int median(int a, int b, int c) {
        if (a < b && a > c)
            return a;
        else if (a > b && a < c)
            return a;
        else if (b < a && b > c)
            return b;
        else if (b > a && b < c)
            return b;
        else
            return c;
    }
}